package com.example.chat.model

import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.PrimaryKey
import com.example.featuresdk.R
import java.sql.Timestamp

@Entity
data class Topic (
    @PrimaryKey (autoGenerate = true) val id: Long? = null,
    val title: String = "",
    val category: TopicCategory = TopicCategory.Personal,
    val count: Int = 0, //the count of new messages
    val message: String = "",//the last message
    @ColumnInfo(name="update_timestamp") val timestamp: Timestamp? = null, //the timestamp of last message
    val logo: Int = R.drawable.ic_exasol_dark)


//Room 2.3 and higher includes a default type converter for persisting enums.
enum class TopicCategory{
    Personal,
    Group,
    Service,
    Subscription
}
